import pandas as pd
from pathlib import Path

SRC = Path('stock_technical_indicators.csv')
DST = Path('stock_technical_indicators_clean.csv')

if not SRC.exists():
    raise SystemExit(f'源文件不存在: {SRC.resolve()}')

df = pd.read_csv(SRC)
needed = ["ma5", "ma20", "rsi", "macd", "boll_upper", "boll_lower"]
clean = df.dropna(subset=needed, how="any")
clean.to_csv(DST, index=False)
print(f'已生成: {DST.resolve()}，行数: {len(clean)}')
